{
 "metadata": {
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.2-final"
  },
  "orig_nbformat": 2,
  "kernelspec": {
   "name": "python3",
   "display_name": "Python 3.8.2 32-bit",
   "metadata": {
    "interpreter": {
     "hash": "36152834186cf73b8c5d0fb8cd1e692fcb77f1cc488f1d18fa9229da191d339e"
    }
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2,
 "cells": [
  {
   "source": [
    "import numpy as np\n",
    "# import matplotlib as plt\n",
    "import pandas as pd"
   ],
   "cell_type": "code",
   "metadata": {},
   "execution_count": 60,
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "                          通道                   时间  抓拍图片  照片    相似度  \\\n",
       "序号                                                                   \n",
       "1   10.163.15.10_8443_CAM001  2021-01-10 00:09:18   NaN NaN  39.9%   \n",
       "2   10.163.15.10_8443_CAM001  2021-01-10 00:10:45   NaN NaN  94.2%   \n",
       "3   10.163.15.10_8443_CAM001  2021-01-10 00:11:30   NaN NaN  76.4%   \n",
       "4   10.163.15.10_8443_CAM001  2021-01-10 00:13:22   NaN NaN  64.8%   \n",
       "5   10.163.15.10_8443_CAM001  2021-01-10 00:15:54   NaN NaN  93.2%   \n",
       "\n",
       "                   目标    目标库 目标类型  温度   口罩  \n",
       "序号                                          \n",
       "1   机场巴士-陈红星-现有积分 20分   机场巴士  白名单 NaN  戴口罩  \n",
       "2   首都飞维-赵子豪-现有积分 20分   首都飞维  白名单 NaN  戴口罩  \n",
       "3   机场巴士-陈子勋-现有积分 20分   机场巴士  白名单 NaN  戴口罩  \n",
       "4    中联航-赵静-现有积分 20分     中联航  白名单 NaN  戴口罩  \n",
       "5   服务品质部-姬超-现有积分 20分  服务品质部  白名单 NaN  戴口罩  "
      ],
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>通道</th>\n      <th>时间</th>\n      <th>抓拍图片</th>\n      <th>照片</th>\n      <th>相似度</th>\n      <th>目标</th>\n      <th>目标库</th>\n      <th>目标类型</th>\n      <th>温度</th>\n      <th>口罩</th>\n    </tr>\n    <tr>\n      <th>序号</th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>1</th>\n      <td>10.163.15.10_8443_CAM001</td>\n      <td>2021-01-10 00:09:18</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>39.9%</td>\n      <td>机场巴士-陈红星-现有积分 20分</td>\n      <td>机场巴士</td>\n      <td>白名单</td>\n      <td>NaN</td>\n      <td>戴口罩</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>10.163.15.10_8443_CAM001</td>\n      <td>2021-01-10 00:10:45</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>94.2%</td>\n      <td>首都飞维-赵子豪-现有积分 20分</td>\n      <td>首都飞维</td>\n      <td>白名单</td>\n      <td>NaN</td>\n      <td>戴口罩</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>10.163.15.10_8443_CAM001</td>\n      <td>2021-01-10 00:11:30</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>76.4%</td>\n      <td>机场巴士-陈子勋-现有积分 20分</td>\n      <td>机场巴士</td>\n      <td>白名单</td>\n      <td>NaN</td>\n      <td>戴口罩</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>10.163.15.10_8443_CAM001</td>\n      <td>2021-01-10 00:13:22</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>64.8%</td>\n      <td>中联航-赵静-现有积分 20分</td>\n      <td>中联航</td>\n      <td>白名单</td>\n      <td>NaN</td>\n      <td>戴口罩</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>10.163.15.10_8443_CAM001</td>\n      <td>2021-01-10 00:15:54</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>93.2%</td>\n      <td>服务品质部-姬超-现有积分 20分</td>\n      <td>服务品质部</td>\n      <td>白名单</td>\n      <td>NaN</td>\n      <td>戴口罩</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "execution_count": 30
    }
   ],
   "source": [
    "data1 = pd.read_excel(r'E:\\HGQ\\study\\1月10日\\比对结果检索_20210207_094251475.xls', index_col='序号').iloc[:, :10]\n",
    "data2 = pd.read_excel(r'E:\\HGQ\\study\\1月10日\\比对结果检索_20210207_094341931.xls', index_col='序号').iloc[:, :10]\n",
    "data3 = pd.read_excel(r'E:\\HGQ\\study\\1月10日\\比对结果检索_20210207_094357059.xls', index_col='序号').iloc[:, :10]\n",
    "data1.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "                          通道                   时间  抓拍图片  照片    相似度  \\\n",
       "序号                                                                   \n",
       "1   10.163.15.10_8443_CAM001  2021-01-10 00:09:18   NaN NaN  39.9%   \n",
       "2   10.163.15.10_8443_CAM001  2021-01-10 00:10:45   NaN NaN  94.2%   \n",
       "3   10.163.15.10_8443_CAM001  2021-01-10 00:11:30   NaN NaN  76.4%   \n",
       "4   10.163.15.10_8443_CAM001  2021-01-10 00:13:22   NaN NaN  64.8%   \n",
       "5   10.163.15.10_8443_CAM001  2021-01-10 00:15:54   NaN NaN  93.2%   \n",
       "..                       ...                  ...   ...  ..    ...   \n",
       "31   10.163.15.4_8443_CAM001  2021-01-10 20:19:51   NaN NaN  91.6%   \n",
       "32   10.163.15.4_8443_CAM001  2021-01-10 21:01:21   NaN NaN  98.1%   \n",
       "33   10.163.15.4_8443_CAM001  2021-01-10 21:37:13   NaN NaN    99%   \n",
       "34   10.163.15.4_8443_CAM001  2021-01-10 21:59:25   NaN NaN  99.5%   \n",
       "35   10.163.15.4_8443_CAM001  2021-01-10 23:55:08   NaN NaN    99%   \n",
       "\n",
       "                     目标     目标库 目标类型  温度    口罩  \n",
       "序号                                              \n",
       "1     机场巴士-陈红星-现有积分 20分    机场巴士  白名单 NaN   戴口罩  \n",
       "2     首都飞维-赵子豪-现有积分 20分    首都飞维  白名单 NaN   戴口罩  \n",
       "3     机场巴士-陈子勋-现有积分 20分    机场巴士  白名单 NaN   戴口罩  \n",
       "4      中联航-赵静-现有积分 20分      中联航  白名单 NaN   戴口罩  \n",
       "5     服务品质部-姬超-现有积分 20分   服务品质部  白名单 NaN   戴口罩  \n",
       "..                  ...     ...  ...  ..   ...  \n",
       "31  航站楼管理部-刘修瑞-现有积分 20分  航站楼管理部  白名单 NaN  未戴口罩  \n",
       "32    南航公司-刘启苏-现有积分 20分      南航  白名单 NaN   戴口罩  \n",
       "33    南航公司-刘启苏-现有积分 20分      南航  白名单 NaN   戴口罩  \n",
       "34    南航公司-刘启苏-现有积分 20分      南航  白名单 NaN  未戴口罩  \n",
       "35    南航公司-刘启苏-现有积分 20分      南航  白名单 NaN   戴口罩  \n",
       "\n",
       "[433 rows x 10 columns]"
      ],
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>通道</th>\n      <th>时间</th>\n      <th>抓拍图片</th>\n      <th>照片</th>\n      <th>相似度</th>\n      <th>目标</th>\n      <th>目标库</th>\n      <th>目标类型</th>\n      <th>温度</th>\n      <th>口罩</th>\n    </tr>\n    <tr>\n      <th>序号</th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>1</th>\n      <td>10.163.15.10_8443_CAM001</td>\n      <td>2021-01-10 00:09:18</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>39.9%</td>\n      <td>机场巴士-陈红星-现有积分 20分</td>\n      <td>机场巴士</td>\n      <td>白名单</td>\n      <td>NaN</td>\n      <td>戴口罩</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>10.163.15.10_8443_CAM001</td>\n      <td>2021-01-10 00:10:45</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>94.2%</td>\n      <td>首都飞维-赵子豪-现有积分 20分</td>\n      <td>首都飞维</td>\n      <td>白名单</td>\n      <td>NaN</td>\n      <td>戴口罩</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>10.163.15.10_8443_CAM001</td>\n      <td>2021-01-10 00:11:30</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>76.4%</td>\n      <td>机场巴士-陈子勋-现有积分 20分</td>\n      <td>机场巴士</td>\n      <td>白名单</td>\n      <td>NaN</td>\n      <td>戴口罩</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>10.163.15.10_8443_CAM001</td>\n      <td>2021-01-10 00:13:22</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>64.8%</td>\n      <td>中联航-赵静-现有积分 20分</td>\n      <td>中联航</td>\n      <td>白名单</td>\n      <td>NaN</td>\n      <td>戴口罩</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>10.163.15.10_8443_CAM001</td>\n      <td>2021-01-10 00:15:54</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>93.2%</td>\n      <td>服务品质部-姬超-现有积分 20分</td>\n      <td>服务品质部</td>\n      <td>白名单</td>\n      <td>NaN</td>\n      <td>戴口罩</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>31</th>\n      <td>10.163.15.4_8443_CAM001</td>\n      <td>2021-01-10 20:19:51</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>91.6%</td>\n      <td>航站楼管理部-刘修瑞-现有积分 20分</td>\n      <td>航站楼管理部</td>\n      <td>白名单</td>\n      <td>NaN</td>\n      <td>未戴口罩</td>\n    </tr>\n    <tr>\n      <th>32</th>\n      <td>10.163.15.4_8443_CAM001</td>\n      <td>2021-01-10 21:01:21</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>98.1%</td>\n      <td>南航公司-刘启苏-现有积分 20分</td>\n      <td>南航</td>\n      <td>白名单</td>\n      <td>NaN</td>\n      <td>戴口罩</td>\n    </tr>\n    <tr>\n      <th>33</th>\n      <td>10.163.15.4_8443_CAM001</td>\n      <td>2021-01-10 21:37:13</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>99%</td>\n      <td>南航公司-刘启苏-现有积分 20分</td>\n      <td>南航</td>\n      <td>白名单</td>\n      <td>NaN</td>\n      <td>戴口罩</td>\n    </tr>\n    <tr>\n      <th>34</th>\n      <td>10.163.15.4_8443_CAM001</td>\n      <td>2021-01-10 21:59:25</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>99.5%</td>\n      <td>南航公司-刘启苏-现有积分 20分</td>\n      <td>南航</td>\n      <td>白名单</td>\n      <td>NaN</td>\n      <td>未戴口罩</td>\n    </tr>\n    <tr>\n      <th>35</th>\n      <td>10.163.15.4_8443_CAM001</td>\n      <td>2021-01-10 23:55:08</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>99%</td>\n      <td>南航公司-刘启苏-现有积分 20分</td>\n      <td>南航</td>\n      <td>白名单</td>\n      <td>NaN</td>\n      <td>戴口罩</td>\n    </tr>\n  </tbody>\n</table>\n<p>433 rows × 10 columns</p>\n</div>"
     },
     "metadata": {},
     "execution_count": 38
    }
   ],
   "source": [
    "data = pd.concat([data1, data2, data3])\n",
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "南航公司-刘启苏-现有积分 20分     22\n",
       "北京城建-韩彬-现有积分 20分      14\n",
       "BCS-李阳-现有积分 20分       13\n",
       "东航-李文锴-现有积分 20分       11\n",
       "运行管理部-刘子璇-现有积分 20分    10\n",
       "                      ..\n",
       "国航公司-杜海啸-现有积分 20分      1\n",
       "航站楼管理部-伍霄-现有积分 20分     1\n",
       "运行管理部-孙国钦-现有积分 20分     1\n",
       "BCS-孟凡博-现有积分 20分       1\n",
       "首都航-陈浩-现有积分 20分        1\n",
       "Name: 目标, Length: 154, dtype: int64"
      ]
     },
     "metadata": {},
     "execution_count": 95
    }
   ],
   "source": [
    "res = data['目标'].value_counts()\n",
    "res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 118,
   "metadata": {},
   "outputs": [
    {
     "output_type": "error",
     "ename": "KeyError",
     "evalue": "\"[('10.163.15.10_8443_CAM001', '2021-01-10 00:09:18', nan, nan, '39.9%', '机场巴士-陈红星-现有积分 20分', '机场巴士', '白名单', nan, '戴口罩')] not found in axis\"",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mKeyError\u001b[0m                                  Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-118-755a012cabea>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m      5\u001b[0m         \u001b[1;32mcontinue\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      6\u001b[0m     \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 7\u001b[1;33m         \u001b[0mdata\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdrop\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mdata\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0miloc\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0my\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      8\u001b[0m         \u001b[0mres\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m-=\u001b[0m \u001b[1;36m1\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\AppData\\Local\\Programs\\Python\\Python38-32\\lib\\site-packages\\pandas\\core\\frame.py\u001b[0m in \u001b[0;36mdrop\u001b[1;34m(self, labels, axis, index, columns, level, inplace, errors)\u001b[0m\n\u001b[0;32m   4303\u001b[0m                 \u001b[0mweight\u001b[0m  \u001b[1;36m1.0\u001b[0m     \u001b[1;36m0.8\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   4304\u001b[0m         \"\"\"\n\u001b[1;32m-> 4305\u001b[1;33m         return super().drop(\n\u001b[0m\u001b[0;32m   4306\u001b[0m             \u001b[0mlabels\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mlabels\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   4307\u001b[0m             \u001b[0maxis\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0maxis\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\AppData\\Local\\Programs\\Python\\Python38-32\\lib\\site-packages\\pandas\\core\\generic.py\u001b[0m in \u001b[0;36mdrop\u001b[1;34m(self, labels, axis, index, columns, level, inplace, errors)\u001b[0m\n\u001b[0;32m   4150\u001b[0m         \u001b[1;32mfor\u001b[0m \u001b[0maxis\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mlabels\u001b[0m \u001b[1;32min\u001b[0m \u001b[0maxes\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mitems\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   4151\u001b[0m             \u001b[1;32mif\u001b[0m \u001b[0mlabels\u001b[0m \u001b[1;32mis\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[1;32mNone\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 4152\u001b[1;33m                 \u001b[0mobj\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mobj\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_drop_axis\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mlabels\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0maxis\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mlevel\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mlevel\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0merrors\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0merrors\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   4153\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   4154\u001b[0m         \u001b[1;32mif\u001b[0m \u001b[0minplace\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\AppData\\Local\\Programs\\Python\\Python38-32\\lib\\site-packages\\pandas\\core\\generic.py\u001b[0m in \u001b[0;36m_drop_axis\u001b[1;34m(self, labels, axis, level, errors)\u001b[0m\n\u001b[0;32m   4204\u001b[0m                 \u001b[0mlabels_missing\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m(\u001b[0m\u001b[0maxis\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget_indexer_for\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mlabels\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;33m==\u001b[0m \u001b[1;33m-\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0many\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   4205\u001b[0m                 \u001b[1;32mif\u001b[0m \u001b[0merrors\u001b[0m \u001b[1;33m==\u001b[0m \u001b[1;34m\"raise\"\u001b[0m \u001b[1;32mand\u001b[0m \u001b[0mlabels_missing\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 4206\u001b[1;33m                     \u001b[1;32mraise\u001b[0m \u001b[0mKeyError\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34mf\"{labels} not found in axis\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   4207\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   4208\u001b[0m             \u001b[0mslicer\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[0mslice\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;32mNone\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m*\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mndim\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mKeyError\u001b[0m: \"[('10.163.15.10_8443_CAM001', '2021-01-10 00:09:18', nan, nan, '39.9%', '机场巴士-陈红星-现有积分 20分', '机场巴士', '白名单', nan, '戴口罩')] not found in axis\""
     ]
    }
   ],
   "source": [
    "y = -1\n",
    "for i in data['目标'].tolist():\n",
    "    y += 1\n",
    "    if res[i]==1:\n",
    "        continue\n",
    "    else:\n",
    "        data.drop([data.iloc[y]])\n",
    "        res[i] -= 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 120,
   "metadata": {},
   "outputs": [
    {
     "output_type": "stream",
     "name": "stderr",
     "text": [
      "<ipython-input-120-531e1c94bb5c>:1: FutureWarning: As the xlwt package is no longer maintained, the xlwt engine will be removed in a future version of pandas. This is the only engine in pandas that supports writing in the xls format. Install openpyxl and write to an xlsx file instead. You can set the option io.excel.xls.writer to 'xlwt' to silence this warning. While this option is deprecated and will also raise a warning, it can be globally set and the warning suppressed.\n  data.to_excel(r'E:\\HGQ\\study\\1月10日\\合并结果.xls')\n"
     ]
    }
   ],
   "source": [
    "data.to_excel(r'E:\\HGQ\\study\\1月10日\\合并结果.xls')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 119,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "                          通道                   时间  抓拍图片  照片    相似度  \\\n",
       "序号                                                                   \n",
       "1   10.163.15.10_8443_CAM001  2021-01-10 00:09:18   NaN NaN  39.9%   \n",
       "2   10.163.15.10_8443_CAM001  2021-01-10 00:10:45   NaN NaN  94.2%   \n",
       "3   10.163.15.10_8443_CAM001  2021-01-10 00:11:30   NaN NaN  76.4%   \n",
       "4   10.163.15.10_8443_CAM001  2021-01-10 00:13:22   NaN NaN  64.8%   \n",
       "5   10.163.15.10_8443_CAM001  2021-01-10 00:15:54   NaN NaN  93.2%   \n",
       "..                       ...                  ...   ...  ..    ...   \n",
       "31   10.163.15.4_8443_CAM001  2021-01-10 20:19:51   NaN NaN  91.6%   \n",
       "32   10.163.15.4_8443_CAM001  2021-01-10 21:01:21   NaN NaN  98.1%   \n",
       "33   10.163.15.4_8443_CAM001  2021-01-10 21:37:13   NaN NaN    99%   \n",
       "34   10.163.15.4_8443_CAM001  2021-01-10 21:59:25   NaN NaN  99.5%   \n",
       "35   10.163.15.4_8443_CAM001  2021-01-10 23:55:08   NaN NaN    99%   \n",
       "\n",
       "                     目标     目标库 目标类型  温度    口罩  \n",
       "序号                                              \n",
       "1     机场巴士-陈红星-现有积分 20分    机场巴士  白名单 NaN   戴口罩  \n",
       "2     首都飞维-赵子豪-现有积分 20分    首都飞维  白名单 NaN   戴口罩  \n",
       "3     机场巴士-陈子勋-现有积分 20分    机场巴士  白名单 NaN   戴口罩  \n",
       "4      中联航-赵静-现有积分 20分      中联航  白名单 NaN   戴口罩  \n",
       "5     服务品质部-姬超-现有积分 20分   服务品质部  白名单 NaN   戴口罩  \n",
       "..                  ...     ...  ...  ..   ...  \n",
       "31  航站楼管理部-刘修瑞-现有积分 20分  航站楼管理部  白名单 NaN  未戴口罩  \n",
       "32    南航公司-刘启苏-现有积分 20分      南航  白名单 NaN   戴口罩  \n",
       "33    南航公司-刘启苏-现有积分 20分      南航  白名单 NaN   戴口罩  \n",
       "34    南航公司-刘启苏-现有积分 20分      南航  白名单 NaN  未戴口罩  \n",
       "35    南航公司-刘启苏-现有积分 20分      南航  白名单 NaN   戴口罩  \n",
       "\n",
       "[433 rows x 10 columns]"
      ],
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>通道</th>\n      <th>时间</th>\n      <th>抓拍图片</th>\n      <th>照片</th>\n      <th>相似度</th>\n      <th>目标</th>\n      <th>目标库</th>\n      <th>目标类型</th>\n      <th>温度</th>\n      <th>口罩</th>\n    </tr>\n    <tr>\n      <th>序号</th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>1</th>\n      <td>10.163.15.10_8443_CAM001</td>\n      <td>2021-01-10 00:09:18</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>39.9%</td>\n      <td>机场巴士-陈红星-现有积分 20分</td>\n      <td>机场巴士</td>\n      <td>白名单</td>\n      <td>NaN</td>\n      <td>戴口罩</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>10.163.15.10_8443_CAM001</td>\n      <td>2021-01-10 00:10:45</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>94.2%</td>\n      <td>首都飞维-赵子豪-现有积分 20分</td>\n      <td>首都飞维</td>\n      <td>白名单</td>\n      <td>NaN</td>\n      <td>戴口罩</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>10.163.15.10_8443_CAM001</td>\n      <td>2021-01-10 00:11:30</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>76.4%</td>\n      <td>机场巴士-陈子勋-现有积分 20分</td>\n      <td>机场巴士</td>\n      <td>白名单</td>\n      <td>NaN</td>\n      <td>戴口罩</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>10.163.15.10_8443_CAM001</td>\n      <td>2021-01-10 00:13:22</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>64.8%</td>\n      <td>中联航-赵静-现有积分 20分</td>\n      <td>中联航</td>\n      <td>白名单</td>\n      <td>NaN</td>\n      <td>戴口罩</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>10.163.15.10_8443_CAM001</td>\n      <td>2021-01-10 00:15:54</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>93.2%</td>\n      <td>服务品质部-姬超-现有积分 20分</td>\n      <td>服务品质部</td>\n      <td>白名单</td>\n      <td>NaN</td>\n      <td>戴口罩</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>31</th>\n      <td>10.163.15.4_8443_CAM001</td>\n      <td>2021-01-10 20:19:51</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>91.6%</td>\n      <td>航站楼管理部-刘修瑞-现有积分 20分</td>\n      <td>航站楼管理部</td>\n      <td>白名单</td>\n      <td>NaN</td>\n      <td>未戴口罩</td>\n    </tr>\n    <tr>\n      <th>32</th>\n      <td>10.163.15.4_8443_CAM001</td>\n      <td>2021-01-10 21:01:21</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>98.1%</td>\n      <td>南航公司-刘启苏-现有积分 20分</td>\n      <td>南航</td>\n      <td>白名单</td>\n      <td>NaN</td>\n      <td>戴口罩</td>\n    </tr>\n    <tr>\n      <th>33</th>\n      <td>10.163.15.4_8443_CAM001</td>\n      <td>2021-01-10 21:37:13</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>99%</td>\n      <td>南航公司-刘启苏-现有积分 20分</td>\n      <td>南航</td>\n      <td>白名单</td>\n      <td>NaN</td>\n      <td>戴口罩</td>\n    </tr>\n    <tr>\n      <th>34</th>\n      <td>10.163.15.4_8443_CAM001</td>\n      <td>2021-01-10 21:59:25</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>99.5%</td>\n      <td>南航公司-刘启苏-现有积分 20分</td>\n      <td>南航</td>\n      <td>白名单</td>\n      <td>NaN</td>\n      <td>未戴口罩</td>\n    </tr>\n    <tr>\n      <th>35</th>\n      <td>10.163.15.4_8443_CAM001</td>\n      <td>2021-01-10 23:55:08</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>99%</td>\n      <td>南航公司-刘启苏-现有积分 20分</td>\n      <td>南航</td>\n      <td>白名单</td>\n      <td>NaN</td>\n      <td>戴口罩</td>\n    </tr>\n  </tbody>\n</table>\n<p>433 rows × 10 columns</p>\n</div>"
     },
     "metadata": {},
     "execution_count": 119
    }
   ],
   "source": [
    "data"
   ]
  }
 ]
}